﻿using Ecommerce.API.Application.Command.LeaveCommand;
using Ecommerce.Domain.User;
using Ecommerce.Services.Leaves;
using MediatR;

namespace Ecommerce.API.Application.CommandHandlers.LeaveHandler
{
    public class AccountgetCommandHandler : IRequestHandler<AccountgetCommand, List<Account>>
    {
        private readonly ILeaveServices services;

        public AccountgetCommandHandler(ILeaveServices services)
        {
            this.services = services;
        }

        public Task<List<Account>> Handle(AccountgetCommand request, CancellationToken cancellationToken)
        {
            return services.GetRoles();
        }
    }
}
